package com.test.pudamoney.activity_fragment_pudamoney.base_pudamoney;

import android.net.Uri;

import com.test.pudamoney.activity_fragment_pudamoney.loan_pudamoney.LoanApplyActivity_pudamoney;
import com.test.pudamoney.bean_pudamoney.process_pudamoney.ProcessInfo_pudamoney;
import com.test.pudamoney.constant_pudamoney.Constant_pudamoney;
import com.test.pudamoney.util_pudamoney.http_pudamoney.HttpManager_pudamoney;
import com.test.pudamoney.activity_fragment_pudamoney.info_pudamoney.InfoUploadActivity_pudamoney;


public abstract class BaseInfoActivity_pudamoney extends BaseActivity_pudamoney {

    public Uri photoUri_pudamoney;

    private Runnable onPermissionAllPassRun_pudamoney;

    public void onInfoUploadResponse_pudamoney(){
        HttpManager_pudamoney.getInstance().requestUserProcess();
    }

    @Override
    public void onUserProcessResponse_pudamoney() {

        if (ProcessInfo_pudamoney.getInstance().getStepsSize()>0){
            startActivity_pudamoney(InfoUploadActivity_pudamoney.class);
        }

        else {//如果不是处理还款流程、状态流程、认证流程，直接去借款确认页
            startActivity_pudamoney(LoanApplyActivity_pudamoney.class);
            HttpManager_pudamoney.getInstance().requestLoanApplyDetail();
        }

        finish();

    }

    public void onLoanApplyDetailResponse_pudamoney(){
        startActivity_pudamoney(LoanApplyActivity_pudamoney.class);
    }

    public void setOnPermissionAllPassRun_pudamoney(Runnable onPermissionAllPassRun_pudamoney) {
        this.onPermissionAllPassRun_pudamoney = onPermissionAllPassRun_pudamoney;
    }

    @Override
    protected void onLaunchPermissionsAllPass_pudamoney() {
        if (onPermissionAllPassRun_pudamoney !=null){
            onPermissionAllPassRun_pudamoney.run();
            onPermissionAllPassRun_pudamoney = null;
        }
    }
}
